<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>#{empty pageTitle ? '{#pageTitle}' : pageTitle}</title>
	<link rel="icon" href="#{resource['favicon.ico']}" />
	<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
	<h:outputStylesheet name="bootstrap.css" />
	<h:outputStylesheet name="forge-style.css" />
	<h:outputStylesheet name="datepicker.css" />
	<h:outputScript name="js/bootstrap-datepicker.js"/>
	<h:outputScript name="js/bootstrap.js"/>
</h:head>

<h:body>
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<h:link id="brandLink" outcome="/index.xhtml" styleClass="brand">Flight 2013</h:link>
				<div class="nav-collapse collapse">
					<ul class="nav">
						<li><h:link value="Zarejestruj się" outcome="/register" rendered="#{not identity.loggedIn}"/></li>
						<li><h:link value="Zaloguj się" outcome="/login" rendered="#{not identity.loggedIn}" /></li>
						<h:form rendered="#{identity.loggedIn}" > 
							<li><h:outputText value="(#{credentials.username})" rendered="#{identity.loggedIn}" styleClass="user"/> <h:commandLink value="Wyloguj" action="#{identity.logout()}" rendered="#{identity.loggedIn}" styleClass="btn btn-link"/></li>
						</h:form>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div class="container forgecontainer">
		<div id="navigation">
			<h:link id="homeLink" outcome="/index.xhtml">
				<img src="#{resource['flight-world.png']}" alt="Flight 2013 " border="0"  style="width: 150px; height: 150px" />
			</h:link>
			<h:panelGroup rendered="#{identity.hasRole('admin','aaa','bbb')}">
			<ul>
				<li>
					<h:link outcome="/city/search" value="City"/>
				</li>
				<li>
					<h:link outcome="/flyFirm/search" value="Fly Firm"/>
				</li>
				<li>
					<h:link outcome="/klient/search" value="Klient"/>
				</li>
				<li>
					<h:link outcome="/route/search" value="Route"/>
				</li>
				<li>
					<h:link outcome="/users/search" value="Users"/>
				</li>
			</ul>
			</h:panelGroup>
		</div>

		<div id="content">
			<h1>
				<ui:insert name="header" />
			</h1>
			<h2>
				<ui:insert name="subheader" />
			</h2>

			<ui:insert name="main" />
		</div>
	</div>

	<footer>
		<div id="footer-wrapper">
	    	<p>&#169; Flight 2013</p>
	    </div>
	</footer>

</h:body>
</html>
